package com.yang.controller.wx;

import com.yang.bean.common.BaseRespVo;
import com.yang.bean.yvo.wx.CatalogBean;
import com.yang.bean.yvo.wx.CurrentBean;
import com.yang.service.wx.WXCataLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: 杨庆
 * @since: 2022.9.9 14:54
 * @description:
 */
@RestController
@RequestMapping("wx/catalog/")
public class WXCatalogController {
    @Autowired
    WXCataLogService wxCataLogService;
    /**
    * @description: 分类的显示
    []
    * @return: com.yang.bean.common.BaseRespVo
    * @author: 杨庆
    * @time: 2022.9.9 14:55
     */
    @RequestMapping("index")
    public BaseRespVo index() {
        CatalogBean catalogBean = wxCataLogService.selectList();
        return BaseRespVo.ok(catalogBean);
    }

    /**
    * @description: 根据一级类类目的信息查看所有的
    []
    * @return: com.yang.bean.common.BaseRespVo
    * @author: 杨庆
    * @time: 2022.9.9 15:25
     */
    @RequestMapping("current")
    public BaseRespVo current(Integer id) {
        CurrentBean currentBean = wxCataLogService.selectById(id);
        return BaseRespVo.ok(currentBean);
    }
}
